﻿using System.Runtime.Remoting.Messaging;

namespace FriendAD.Core
{
   public class ContextFactory
    {
        /// <summary>
        /// 获取当前线程的数据上下文
        /// </summary>
        /// <returns>数据上下文</returns>
        public static FriendADContext CurrentContext()
        {
            FriendADContext _nContext = CallContext.GetData("FriendADContext") as FriendADContext;
            if (_nContext==null)
            {
                _nContext = new FriendADContext();
                CallContext.SetData("FriendADContext", _nContext);
            }
            return _nContext;
        }


    }
}
